net.minecraft.src.customstuff.scripts
Class Player

java.lang.Object
  extended by net.minecraft.src.customstuff.scripts.Living
      extended by net.minecraft.src.customstuff.scripts.Player

public class Player
extends Living


Field Summary
 net.minecraft.src.EntityPlayer player
           
 
Constructor Summary
Player(net.minecraft.src.EntityPlayer player, World world)
           
 
Method Summary
 void addHunger(int i)
          Adds to the player's hunger
 void addSaturation(float f)
          Adds saturation to the player
 void addToInventory(int id, int count, int damage)
          Adds items to the players inventory, if there is space for them.
 void addToInventorySlot(int slotId, int count)
          Adds items to an inventory slot if it isn't empty
 void clearInventory()
          Clears the player inventory (not the armor inventory).
 void clearInventorySlot(int slotId)
          Clears an inventory slot
 void damageItem(int slotId, int damage)
          Damages an item in the given inventory slot
 void fillInventory(int id, int damage)
          Fills the player's inventory with the given item.
 void fillInventorySlot(int slotId)
          Fills an inventory slot if it is empty
 int getCurrentSlot()
           
 float getHunger()
           
 int getItemCount(int id, int damage)
           
 int getItemDamage(int slotId)
           
 int getItemId(int slotId)
           
 int getItemStackSize(int slotId)
           
 int getLookX(int distance)
           
 int getLookY(int distance)
           
 int getLookZ(int distance)
           
 int getMaxItemDamage(int slotId)
           
 float getSaturation()
           
 boolean isFuelInSlot(int slot)
           
 void placeBlock(int i, int j, int k, int id, int damage, int side)
          Adds a block on the given side of the block at the given coordinates
 void placeBlock(net.minecraft.src.customstuff.scripts.Position pos, int id, int damage, int side)
          Adds a block on the given side of the block at the given position
 void removeFromInventory(int id, int count, int damage)
          Removes items from the players inventory
 void removeFromInventorySlot(int slotId, int count)
          Removes items from an inventory slot
 void sendMessage(java.lang.String message)
          Adds a message to the player
 void setHunger(int i)
          Sets the player's hunger
 void setInventorySlot(int slotId, int id, int count, int damage)
          Sets the content of an inventory slot
 void setItemInUse()
          Sets the current item in use
 void setSaturation(float f)
          Sets the player's saturation
 
Methods inherited from class net.minecraft.src.customstuff.scripts.Living
addVelo, dropItem, getHealth, getLookingSide, getPositionX, getPositionY, getPositionZ, getType, move, move, setHealth, setOnFire, setPosition, setPosition
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

player

public net.minecraft.src.EntityPlayer player
Constructor Detail

Player

public Player(net.minecraft.src.EntityPlayer player,
              World world)
Method Detail

sendMessage

public void sendMessage(java.lang.String message)
Adds a message to the player

Parameters:
message - The message to send

clearInventory

public void clearInventory()
Clears the player inventory (not the armor inventory).


fillInventory

public void fillInventory(int id,
                          int damage)
Fills the player's inventory with the given item. This does not replace existing items.

Parameters:
id - The id of the item
damage - The damage values of the item

addToInventory

public void addToInventory(int id,
                           int count,
                           int damage)
Adds items to the players inventory, if there is space for them.

Parameters:
id - The item's id
count - The item's amount
damage - The item's damage value

removeFromInventory

public void removeFromInventory(int id,
                                int count,
                                int damage)
Removes items from the players inventory

Parameters:
id - The item's id
count - The item's amount
damage - The item's damage value

clearInventorySlot

public void clearInventorySlot(int slotId)
Clears an inventory slot

Parameters:
slotId - The slot's id

fillInventorySlot

public void fillInventorySlot(int slotId)
Fills an inventory slot if it is empty

Parameters:
slotId - The slot's id

setInventorySlot

public void setInventorySlot(int slotId,
                             int id,
                             int count,
                             int damage)
Sets the content of an inventory slot

Parameters:
slotId - The slot's id
id - The item's id
count - The item's amount
damage - The item's damage value

removeFromInventorySlot

public void removeFromInventorySlot(int slotId,
                                    int count)
Removes items from an inventory slot

Parameters:
slotId - The slot's id
count - The amount to remove

addToInventorySlot

public void addToInventorySlot(int slotId,
                               int count)
Adds items to an inventory slot if it isn't empty

Parameters:
slotId - The slot's id
count - The amount to add

damageItem

public void damageItem(int slotId,
                       int damage)
Damages an item in the given inventory slot

Parameters:
slotId - The slot's id
damage - The damage to add to the item

placeBlock

public void placeBlock(net.minecraft.src.customstuff.scripts.Position pos,
                       int id,
                       int damage,
                       int side)
Adds a block on the given side of the block at the given position

Parameters:
pos - The position to add the block at a side
id - The id of the block to add
damage - The damage block of the block to add
side - The side on the block at pos

placeBlock

public void placeBlock(int i,
                       int j,
                       int k,
                       int id,
                       int damage,
                       int side)
Adds a block on the given side of the block at the given coordinates

Parameters:
i - The x-coordinate
j - The y-coordinate
k - The z coordinate
id - The block's id
damage - The block's damage value
side - The side on the block at x,y,z

setSaturation

public void setSaturation(float f)
Sets the player's saturation

Parameters:
f -

addSaturation

public void addSaturation(float f)
Adds saturation to the player

Parameters:
f -

setHunger

public void setHunger(int i)
Sets the player's hunger

Parameters:
i -

addHunger

public void addHunger(int i)
Adds to the player's hunger

Parameters:
i -

setItemInUse

public void setItemInUse()
Sets the current item in use


getCurrentSlot

public int getCurrentSlot()
Returns:
The current slot id

getItemId

public int getItemId(int slotId)
Parameters:
slotId - The slot's id
Returns:
The id of the item in the slot or -1 if it is empty

getItemStackSize

public int getItemStackSize(int slotId)
Parameters:
slotId - The slot's id
Returns:
The stacksize of the item in the slot or -1 if it is empty

getItemDamage

public int getItemDamage(int slotId)
Parameters:
slotId - The slot's id
Returns:
The damage value of the item in the slot or -1 if it is empty

getMaxItemDamage

public int getMaxItemDamage(int slotId)
Parameters:
slotId - The slot's id
Returns:
The max damage of the item in the slot or -1 if it is empty

getItemCount

public int getItemCount(int id,
                        int damage)
Parameters:
id - The item's id
damage - The items' damage value
Returns:
The amount of items in the players inventory

isFuelInSlot

public boolean isFuelInSlot(int slot)
Parameters:
slot - The slot's id
Returns:
true if there is fuel in the slot, false otherwise

getSaturation

public float getSaturation()
Returns:
The player's saturation

getHunger

public float getHunger()
Returns:
The player's hunger

getLookX

public int getLookX(int distance)
Parameters:
distance - The maximum distance
Returns:
The x-coordinate of the block the player is looking at

getLookY

public int getLookY(int distance)
Parameters:
distance - The maximum distance
Returns:
The y-coordinate of the block the player is looking at

getLookZ

public int getLookZ(int distance)
Parameters:
distance - The maximum distance
Returns:
The z-coordinate of the block the player is looking at